<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
	<head>

		<title>My JSP 'gameList.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

		<link rel="stylesheet" href="../css/style.css" type="text/css"></link>
		<script type="text/javascript">
		 	function returnPage(pageNo){
				document.getElementById("form1").pageNo.value=pageNo;
				document.getElementById("form1").submit();
			}
		  	function deleteGame(id){
		  	  	 if(confirm('确定要删除吗?'+id)){
					document.all('game.gameno').value=id;
					document.getElementById("dform").submit();
				}
			}
			
			function addDiv(id){
			  document.getElementById(id).style.display="block";
			  document.getElementById("updateDiv").style.display="none";
			}
			function cancelDiv(id){
			  document.getElementById(id).style.display="none";
			}
		</script>
	</head>

	<body>
		<div align="left">
			<input type="button" class="common_button"
				onclick="javacript:addDiv('createDiv');" value=" 新 增 " />
		</div>
		<form id="form1" name="form1"
			action="/newbingo/test/Game_findByPage.action" method="post">
			<table class="query_form_table" width="80%"
				style="border-width: 1px; border-style: solid;">
				<tr>
					<th align="left">
						编号
					</th>
					<th align="left">
						游戏名称
					</th>
					<th align="left">
						游戏类型
					</th>
					<th align="left">
						游戏规则
					</th>
					<th>
						相关操作
					</th>
				</tr>
				<tbody>
					<s:iterator value="pager.data">
						<tr>
							<td>
								<s:property value="gameno" />
							</td>
							<td>
								<s:property value="gamename" />
							</td>
							<td>
								<s:property value="type" />
							</td>
							<td>
								<s:property value="rule" />
							</td>
							<td align="center">
								<a
									href="/newbingo/test/Game_findById.action?game.gameno=${gameno}"
									class="common_button" />修 改</a>
								<a class="common_button" href="javascript:deleteGame(${gameno})">删
									除</a>
								<a href="#" class="common_button">玩法</a><a
									href="/newbingo/test/GameTable_findByPage.action?game.gameno=${gameno }"
									class="common_button">桌子</a>
							</td>
						</tr>
					</s:iterator>
				</tbody>
			</table>
		</form>
		<form action="/newbingo/test/Game_deleteGame.action" name="dform"
			method="post">
			<input type="hidden" name="game.gameno" />
		</form>
		<div id="createDiv" style="display: none;">
			<form action="/newbingo/test/Game_create.action" method="post">
				<div>
					<table>
						<tr>
							<td>
								游戏名称：
							</td>
							<td>
								<input name="game.gamename" width="100px" />
							</td>
						</tr>
						<tr>
							<td>
								游戏类型：
							</td>
							<td>
								<select name="game.type" width="100px">
									<option value="彩票类">
										彩票类
									</option>
								</select>
							</td>
						</tr>
						<tr>
							<td valign="top">
								游戏规则：
							</td>
							<td>
								<textarea name="game.rule" rows="5" cols="50"></textarea>
							</td>
						</tr>
						<tr>
							<td>
								<input type="submit" class="common_button" value="提 交">
							</td>
							<td>
								<input type="button" class="common_button"
									onclick="javascript:cancelDiv('createDiv');" value="取 消">
							</td>
						</tr>
					</table>

				</div>
			</form>
		</div>
	</body>
</html>
